﻿namespace BEGDC.CC.Web.EZVisit.Controls
{
    using ASBCC.Database.Entity;

    public partial class EZVisitRequestComment : EZVRequestBaseControl
    {
        protected override void SetViewData()
        {
            if (this.EZVisitApplication == null)
            {
                return;
            }

            if (this.Editable)
            {
                this.edt_Comment.Text = this.EZVisitApplication.LGDCheckPersonComments;
                this.edt_CODPPManagerComment.Text = this.EZVisitApplication.QuotationComments;
            }
            else
            {
                this.vw_Comment.Text = this.EZVisitApplication.LGDCheckPersonComments;
                this.vw_CODPPManagerComment.Text = this.EZVisitApplication.QuotationComments;
            }
        }

        public override void Save(EZVisitApplicationTableEntity app)
        {
            if (this.EZVisitApplication == null)
            {
                return;
            }

            this.EZVisitApplication.LGDCheckPersonComments = this.edt_Comment.Text;

            base.Save(app);
        }
    }
}